from typing import List


class Solution:
    def satisfiesConditions(self, grid: List[List[int]]) -> bool:
        for j in range(len(grid[0])):
            if j < len(grid[0]) - 1 and grid[0][j] == grid[0][j + 1]:
                return False
            for i in range(len(grid) - 1):
                if grid[i][j] != grid[i + 1][j]:
                    return False
                else:
                    pass
        return True


if __name__ == '__main__':
    nums = [[1], [1], [1]]
    s = Solution()

    print(s.satisfiesConditions(nums))
